<?php
include_once "conn.php";
$arr=[];
$type = $_GET['type'];
$sql = $db -> query("SELECT goods_id,goods_type,goods_title,goods_url,goods_price
FROM goods WHERE goods_type = '$type'");
while ($row = $sql -> fetch_assoc()) {
    array_push($arr,$row);
}
echo json_encode($arr);
$db->close();
?>